/**
 * 
 */
package com.oron3.bouncer.objects;

import javax.microedition.khronos.opengles.GL10;

import com.oron3.bouncer.genericgl.GL3D;
import com.oron3.bouncer.genericgl.GLWorld;
import com.oron3.bouncer.genericgl.MatrixTrackingGL;
import com.oron3.bouncer.objects.shapes.LineSegment;
import com.oron3.bouncer.objects.shapes.Point;

/**
 * @author Ofek
 *
 */
public class GLLine extends LineSegment implements GLShape {
	public final GL3D gl3d = new GL3D();

	/**
	 * 
	 */
	public GLLine(final LineSegment l) {
		this(l.line.p1,l.p2);

	}
	/**
	 * start at p1 in the direction of p2
	 * @param p1
	 * @param p2
	 */
	public GLLine(final Point p1, final Point p2) {
		super(p1,p2);
		gl3d.add(p1,p2);
		gl3d.prepare();
	}


	@Override
	public void draw(final MatrixTrackingGL gl) {
		gl.glColor4f(0.3f, 0.3f, 1f, 1f);
		gl3d.draw(gl, GL10.GL_LINE_LOOP);
	}



	/* (non-Javadoc)
	 * @see com.oron3.bouncer.objects.GLShape#setColor(com.oron3.bouncer.objects.Color)
	 */
	@Override
	public void setColor(final Color c) {
	}
	/* (non-Javadoc)
	 * @see com.oron3.bouncer.objects.GLShape#step(float, com.oron3.bouncer.genericgl.GLWorld)
	 */
	@Override
	public void step(final float dt, final GLWorld glWorld) {
	}



}
